<%@ page language="java"%>
<%@ page import="java.util.List" %>
<%@ page import=" BE.Cliente" %>
<%@ page import=" BE.Ocurrencia" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-tiles" prefix="tiles" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-nested" prefix="nested" %>
<html:html locale="true">
<head>
    <title>Mobius</title>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="viewport" content="minimum-scale=1.0, width=device-width, maximum-scale=1.6, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon" href="mobLisHojaRuta/Images/WebClipIcon.png">
    <link rel="stylesheet" href="mobLisHojaRuta/mobLisHojaRuta.css">
    <link rel="stylesheet" href="mobLisHojaRuta/Parts/Transitions.css">
    <script type="text/javascript" src="mobLisHojaRuta/Parts/setup.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/mobLisHojaRuta.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/Header.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/utilities.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/Transitions.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/StackLayout.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/Browser.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/Text.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/List.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/PushButton.js" charset="utf-8"></script>
    <script type="text/javascript" src="mobLisHojaRuta/Parts/ButtonHandler.js" charset="utf-8"></script>
    <script type="text/javascript" charset="utf-8">
    // Sample data.  Some applications may have static data like this, but most will want to use information fetched remotely via XMLHttpRequest.


     <%
        List<Cliente> vectorCliente=null;
        if(request.getAttribute("arrClientes")!=null) {
            vectorCliente=(List<Cliente>)request.getAttribute("arrClientes");
        };

        List<Ocurrencia> vectorOcurrenciasEsta=null;
        if(request.getAttribute("arrOcurrenciaEsta")!=null) {
            vectorOcurrenciasEsta=(List<Ocurrencia>)request.getAttribute("arrOcurrenciaEsta");
        };

        List<Ocurrencia> vectorOcurrenciasNoEsta=null;
        if(request.getAttribute("arrOcurrenciaNoEsta")!=null) {
            vectorOcurrenciasNoEsta=(List<Ocurrencia>)request.getAttribute("arrOcurrenciaNoEsta");
        };
    %>

   var parks=new Array(<%= vectorCliente.size() %>);

    <%
    String txtContacto="";
    String txtCell="";
    String txtTelf="";
    String txtDireccion="";
    String txtEmail="";
       for(int i=0; i<vectorCliente.size(); i++) {

            txtContacto=((vectorCliente.get(i)).getCvContacto()==null)?"No Registrado":(vectorCliente.get(i)).getCvContacto();
            txtCell=((vectorCliente.get(i)).getCvTelefono1()==null)?"No Registrado":(vectorCliente.get(i)).getCvTelefono1();
            txtTelf=((vectorCliente.get(i)).getCvTelefono2())==null?"No Registrado":(vectorCliente.get(i)).getCvTelefono2();
            txtDireccion=((vectorCliente.get(i)).getCvDireccion()==null)?"No Registrado":(vectorCliente.get(i)).getCvDireccion();
            txtEmail=((vectorCliente.get(i)).getCvEmail()==null)?"No Registrado":(vectorCliente.get(i)).getCvEmail();

           out.println("parks["+ i +"]  = new Array("+"\"" +(vectorCliente.get(i)).getCvNombre() + " "+ (vectorCliente.get(i)).getCvApellidopaterno() + "\""+","+"\""+ txtContacto+"\""+","+"\""+txtDireccion+"\""+","+"\""+txtCell+"\""+","+"\""+txtTelf+"\""+","+"\""+txtEmail+"\""+","+"\""+(vectorCliente.get(i)).getRlMontolineacredito().doubleValue()+"\""+","+"\""+(vectorCliente.get(i)).getSrlIdpersona()+"\""+");");
       }
    %>

   </script>
    <script type="text/javascript" charset="utf-8">
	addEventListener('load', function() {
		setTimeout(hideAddressBar, 0);
	}, false);
	function hideAddressBar() {
		window.scrollTo(0, 1);
	}
    </script>
</head>
<body onload="load();">
    <html:form action="ResBusquedaCliente">
        <input type="hidden" id="arreglo" value=parks>
        <input type="hidden" name="IdCliente" id="IdCliente" value="">

    <div apple-part="com.apple.Dashcode.part.browser" id="browser">
        <div apple-part="com.apple.Dashcode.part.header" apple-part-locked="true" apple-style="image-theme: 2; image-shape: 3; image-button-type: 3; image-opacity: 1.00; image-top-color: 0.592156887,0.65882355,0.741176486,1; image-bottom-color: 0.411764711,0.513725519,0.635294139,1; image-radius: 0,0,0,0; image-border: 0; image-border-color: 0.529399991,0.529399991,0.529399991,1; image-border-width: 1; shine-on: 0; shine-strength: 0.08; shine-alpha-level: 0.00; shine-height: 0.50; glass-arc-height: 0.00; image-include-custom: 1; image-custom-image-path: mobToolbarBackground 2.png; image-custom-center: 1; image-custom-resize: 2; shadow-include-shadow: 0;" apple-group="header" id="header">
            <div apple-part="com.apple.Dashcode.part.gobackbutton" id="back_button" class="apple-no-children back_button_template dashcode-header-backbutton" apple-part-locked="true" apple-text-overflow="ellipsis" apple-style="image-theme: 0; image-shape: 11; image-button-type: 0; image-opacity: 1.00; image-top-color: 0,0,0,1; image-bottom-color: 1,1,1,1; image-radius: 5,5,5,5; image-border: 1; image-border-color: 0,0,0,0.2; image-border-width: 1; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" apple-template="true"></div>
            <div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 0; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 0,0,0,1; image-bottom-color: 1,1,1,1; image-radius: 5,5,5,5; image-border: 1; image-border-color: 0,0,0,0.2; image-border-width: 1; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnResultados"></div>
        </div>
        <div apple-part="com.apple.Dashcode.part.StackLayout" apple-part-locked="true" id="stackLayout">
            <div id="listLevel" apple-part-locked="true">
                <ul apple-part="com.apple.Dashcode.part.edgeToEdgeList" id="list">
                    <li id="listRowTemplate" class="listRowTemplate_template" apple-template="true">
                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children rowTitle_template" apple-text-overflow="ellipsis" id="rowTitle"></div>
                        <div apple-part="com.apple.Dashcode.part.box" id="rowArrow" class="rowArrow_template"></div>
                    </li>
                </ul>
            </div>
            <div id="detailLevel" apple-part-locked="true" apple-css-background-fill="blank">
                <div apple-part="com.apple.Dashcode.part.rectanglewebshape" apple-style="image-theme: 1; image-shape: 3; image-button-type: 3; image-opacity: 1.00; image-top-color: 0.217608914,0.227588311,0.260624081,1; image-bottom-color: 0.134615093,0.14126803,0.163302049,1; image-radius: 0,0,0,0; image-border: 1; image-border-color: 0,0,0,1; image-border-width: 1; shine-strength: 0.90; shine-alpha-level: 0.67; shine-height: 0.50; glass-arc-height: 0.06; shadow-include-shadow: 0;" id="rectangleShape">
                    <img src="mobLisHojaRuta/Images/Standard-Man-User.png" id="imgUsuario">
                    <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-text-overflow="ellipsis" id="txt_name"></div>
                    <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txt_contact"></div>
                </div>
                <div apple-part="com.apple.Dashcode.part.box" id="box">
                    <div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 3; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 0.290196091,0.423529416,0.607843161,1; image-bottom-color: 1,1,1,1; image-radius: 0,0,0,0; image-border: 0; image-border-color: 0,0,0,0.2; image-border-width: 0; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnInfo" checked="checked"></div>
                    <div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 3; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 0.290196091,0.423529416,0.607843161,1; image-bottom-color: 1,1,1,1; image-radius: 0,0,0,0; image-border: 0; image-border-color: 0,0,0,0.2; image-border-width: 0; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnOcurrencia" checked="checked"></div>
                    <div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 3; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 0.290196091,0.423529416,0.607843161,1; image-bottom-color: 1,1,1,1; image-radius: 0,0,0,0; image-border: 0; image-border-color: 0,0,0,0.2; image-border-width: 0; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnPedido" checked="checked"></div>
                </div>
                <div apple-part="com.apple.Dashcode.part.StackLayout" id="tabsCliente"><div id="informacion" apple-part-locked="true">
                        <div apple-part="com.apple.Dashcode.part.box" id="detailBox">
                            <img src="mobLisHojaRuta/Images/Map%20alt2.png" id="imgMaps">
                            <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txt_adress" onclick="clickDireccion(event)"></div>
                            <img src="mobLisHojaRuta/Images/Phone.png" id="imgPhone">
                            <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txt_telf" apple-style="part-height-dependent: true;" onclick="clickTelf(event)"></div>
                            <img src="mobLisHojaRuta/Images/Phone.png" id="imgPhone2">
                            <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txt_cell" apple-style="part-height-dependent: true;"></div>
                            <img src="mobLisHojaRuta/Images/Mail.png" id="imgMail">
                            <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txt_mail" apple-style="part-height-dependent: true;" onclick="clickMail(event)"></div>
                            <img src="mobLisHojaRuta/Images/Movie%20alt1.png" id="imgExtra">
                            <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txt_LineaCredito" apple-style="part-height-dependent: true;"></div>
                        </div>
                    </div><div id="visita" apple-part-locked="true">
                        <div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 0; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 1,1,1,1; image-bottom-color: 1,1,1,1; image-radius: 5,5,5,5; image-border: 1; image-border-color: 0,0,0,0.2; image-border-width: 1; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnClienteEsta"></div>
                        <div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 0; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 1,1,1,1; image-bottom-color: 1,1,1,1; image-radius: 5,5,5,5; image-border: 1; image-border-color: 0,0,0,0.2; image-border-width: 1; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnClienteNoEsta"></div>
                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children subtitulo" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="lblRegistrarOcurrencia" apple-style="part-width-dependent: true;part-height-dependent: true;"></div>
                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children subtitulo" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="lblRegistrarOcurrenciaDetalle" apple-style="part-width-dependent: true;part-height-dependent: true;"></div>
                        <select name="clienteEsta"apple-part="com.apple.Dashcode.part.inputpopupbutton" apple-style-relative="height: 20px;" id="cbxDetalleEsta" apple-group="popup">
                            <%
                                for(int i=0; i<vectorOcurrenciasEsta.size(); i++) {
                                    out.println("<option class=\"apple-hidden\" value=\""+ (vectorOcurrenciasEsta.get(i)).getSrlIdocurrencia() + "\" id=\"" + (vectorOcurrenciasEsta.get(i)).getCvNombre() + "\">" + (vectorOcurrenciasEsta.get(i)).getCvNombre() + "</option>" );
                                }
                            %>
                        </select>
                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txtInfo" apple-style="part-width-dependent: true;part-height-dependent: true;"></div>
                        <select name="clienteNoEsta" apple-part="com.apple.Dashcode.part.inputpopupbutton" apple-style-relative="height: 20px;" id="cbxDetalleNoEsta" apple-group="cbxDetalle1">
                            <%
                                for(int i=0; i<vectorOcurrenciasNoEsta.size(); i++) {
                                    out.println("<option class=\"apple-hidden\" value=\""+ (vectorOcurrenciasNoEsta.get(i)).getSrlIdocurrencia() + "\" id=\"" + (vectorOcurrenciasNoEsta.get(i)).getCvNombre() + "\">" + (vectorOcurrenciasNoEsta.get(i)).getCvNombre() + "</option>" );
                                }
                            %>
                        </select>
                        <div apple-part="com.apple.Dashcode.part.box" id="boxBotones1" apple-group="boxBotones1">
                            <div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 0; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 0,0,0,1; image-bottom-color: 1,1,1,1; image-radius: 5,5,5,5; image-border: 1; image-border-color: 0,0,0,0.2; image-border-width: 1; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnGuardarOcurrencia"></div>

                        </div>
                        <div apple-part="com.apple.Dashcode.part.box" id="boxBotonesVersion2">
                            <!--<div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 0; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 0,0,0,1; image-bottom-color: 1,1,1,1; image-radius: 5,5,5,5; image-border: 1; image-border-color: 0,0,0,0.2; image-border-width: 1; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnGuardarComentario"></div>-->
                            <html:submit styleId="btnGuardarComentario" property="submit">
                                <bean:message key="button.RegistrarVisita"/>
                            </html:submit>
                        </div>
                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txtInfo2" apple-style="part-height-dependent: true;"></div>
                    </div><div id="pedido" apple-part-locked="true">
                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children subtitulo" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="lblRegistrarPedido" apple-style="part-width-dependent: true;part-height-dependent: true;"></div>

                        <div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 3; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 0.290196091,0.423529416,0.607843161,1; image-bottom-color: 1,1,1,1; image-radius: 0,0,0,0; image-border: 0; image-border-color: 0,0,0,0.2; image-border-width: 1; shine-on: 0; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 0; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnRegistrarPedido" checked="checked"></div>

                            <html:submit property="submit">
                                <bean:message key="button.RegistrarPedido"/>
                            </html:submit>

                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txtInfo3" apple-style="part-height-dependent: true;"></div>

                    </div><div id="comentario" apple-part-locked="true">
                        <textarea name="comentario" apple-part="com.apple.Dashcode.part.textarea" id="textarea"></textarea>
                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children subtitulo" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="lblComentarios" apple-style="part-width-dependent: true;part-height-dependent: true;"></div>
                        <div apple-part="com.apple.Dashcode.part.webtext" class="apple-text apple-no-children" apple-default-image-visibility="hidden" apple-text-overflow="ellipsis" id="txtInfo1" apple-style="part-width-dependent: true;part-height-dependent: true;"></div>
                        <div apple-part="com.apple.Dashcode.part.box" id="boxBotones">
                            <!--<div apple-part="com.apple.Dashcode.part.pushbutton" class="apple-no-children" apple-text-overflow="ellipsis" apple-style="image-theme: 0; image-shape: 3; image-button-type: 0; image-opacity: 1.00; image-top-color: 0,0,0,1; image-bottom-color: 1,1,1,1; image-radius: 5,5,5,5; image-border: 1; image-border-color: 0,0,0,0.2; image-border-width: 1; shine-on: 1; shine-strength: 0.17; shine-alpha-level: 0.04; shine-height: 0.50; glass-arc-height: 0.00; embossed-on: 1; embossed-depth: 1; embossed-shadow: 0.68; embossed-highlight: 0.3; shadow-include-shadow: 0;" id="btnGuardarComentario"></div>-->
                            <html:submit styleId="btnGuardarComentario" property="submit">
                                <bean:message key="button.RegistrarVisita"/>
                            </html:submit>
                        </div>
                    </div></div>
            </div>
        </div>
    </div>
    </html:form>
</body>
</html:html>